/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpaintball;

import java.awt.event.KeyEvent;

/**
 *
 * @author ondra
 */
public class InputController {

    private boolean left;
    private boolean right;
    private boolean up;
    private boolean down;

    private int mouseX;
    private int mouseY;

    /**
     * @return the left
     */
    public boolean isLeft() {
        return left;
    }

    /**
     * @return the right
     */
    public boolean isRight() {
        return right;
    }

    /**
     * @return the up
     */
    public boolean isUp() {
        return up;
    }

    /**
     * @return the down
     */
    public boolean isDown() {
        return down;
    }

    public void setKeys(KeyEvent e) {
       switch (e.getKeyCode()){
            case KeyEvent.VK_A:
            left = true;
            break;
            case KeyEvent.VK_D:
            right = true;
            break;
            case KeyEvent.VK_W:
            up = true;
            break;
            case KeyEvent.VK_S:
            down = true;
            break;
        }
    }
    public void resetKeys(KeyEvent e) {
       switch (e.getKeyCode()){
            case KeyEvent.VK_A:
            left = false;
            break;
            case KeyEvent.VK_D:
            right = false;
            break;
            case KeyEvent.VK_W:
            up = false;
            break;
            case KeyEvent.VK_S:
            down = false;
            break;
        }
    }

    void setMousePosition(int x, int y) {
        mouseX = x;
        mouseY = y;
    }

    /**
     * @return the mouseX
     */
    public int getMouseX() {
        return mouseX;
    }

    /**
     * @return the mouseY
     */
    public int getMouseY() {
        return mouseY;
    }

}
